const express = require("express");
//创建路由对象
const router = express.Router();
// 创建一个简单的 GET 接口
router.get('/', (req, res) => {
  res.json({ message: 'Welcome to my API!' });
});

// 创建一个简单的 POST 接口
router.get('/data', (req, res) => {
  const receivedData = { message: 'Welcome to my API!' };
  res.json({ message: 'Data received', data: receivedData });
});
//注册新用户
router.get("/reguser", (req, res) => {
  res.send("reguser OK111111111111111111111111111");
});

router.post("/login", (req, res) => {
  res.send("login OK");
});


//将路由对象共享出去
module.exports = router;
